package com.林子祺.CAT旅游系统.controller.contentmanagement;

import com.林子祺.CAT旅游系统.dao.placemanagement.AddPlace;
import com.林子祺.CAT旅游系统.dao.placemanagement.DeletePlace;
import com.林子祺.CAT旅游系统.dao.placemanagement.PlacePull;
import com.林子祺.CAT旅游系统.dao.placemanagement.UpdatePlace;
import com.林子祺.CAT旅游系统.dao.ticketmanagement.AddTicket;
import com.林子祺.CAT旅游系统.dao.ticketmanagement.DeleteTicket;
import com.林子祺.CAT旅游系统.dao.ticketmanagement.UpdateTicket;
import com.林子祺.CAT旅游系统.entity.place.PlaceData;
import com.林子祺.CAT旅游系统.entity.ticket.TicketData;
import com.林子祺.CAT旅游系统.view.tour.admin.AdminMenu;

public class Admin {

    public static void AddPlace(String name, String provience, String city, String address, String detail, double price){
        AddPlace.add(name,price,provience,city,address,detail);
        PlaceData.Refresh();
        PlacePull.pull();
        AdminMenu.menu();
    }

    public static void AddTicket(int place_id,String time,double cost,int left){
        AddTicket.add(place_id,time,cost,left);
        TicketData.Refresh();
        AdminMenu.menu();
    }

    public static void ChangePlaceData(int id, String name, String provience, String city, String address, String detail,double price){
        UpdatePlace.update(id,name,price,provience,city,address,detail);
        PlaceData.Refresh();
        PlacePull.pull();
        AdminMenu.menu();
    }

    public static void DeletePlace(int id){
        DeletePlace.Delete(id);
        AdminMenu.menu();
    }

    public static void ChangeTicketData(int ticket_id, int place_id, String time, double cost,int left){
        UpdateTicket.update(ticket_id,place_id,time,cost,left);
        TicketData.Refresh();
        AdminMenu.menu();
    }

    public static void DeleteTicketData(int id){
        DeleteTicket.delete(id);
        TicketData.Refresh();
        AdminMenu.menu();
    }

}
